package com.yupi.springbootinit.BiMQ.BiMq;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.concurrent.TimeoutException;


public class demoTest {
    @Resource
    private static RabbitAdmin rabbitAdmin;



    public static void main(String[] args) throws IOException, TimeoutException {
        ConnectionFactory factory = new ConnectionFactory();
        //2：指定连接服务的主机名以及账号密码
        factory.setHost("47.97.80.75");
        factory.setUsername("lfc123456");
        factory.setPassword("lfc123456");
        //3：创建连接
        Connection connection = factory.newConnection();
        //4：创建频道
        Channel channel = connection.createChannel();
        channel.exchangeDelete(BIMQConstant.BI_EXCHANGE_NAME);
        channel.queueDelete(BIMQConstant.BI_QUEUE_NAME);

    }
}
